#ifndef D3DDRAWER_H
#define D3DDRAWER_H

#include <windows.h>  
#include <d3dx9.h>  

#include "mySingleton.h"

struct Vertex  
{  
    Vertex(); 
    Vertex(float x,float y,float z);
    float _x,_y,_z;  
	D3DCOLOR _color;
    static const DWORD FVF = D3DFVF_XYZ | D3DFVF_DIFFUSE;  
}; 

class d3dDrawer :
	public Singleton<d3dDrawer>
{
public:
	d3dDrawer();
	~d3dDrawer();

	int init(HWND hwnd);
	int begin();
	int render(float timeDelta);
	IDirect3DDevice9* getDevice();
	static const D3DXMATRIX oneMatrix;
private:
	IDirect3D9* m_d3d9;  
	IDirect3DDevice9* m_Device;  
	IDirect3DVertexBuffer9* m_VB;  
	IDirect3DIndexBuffer9* m_IB;  
	bool m_brBegin;
};

#endif